package de.karlNet.sshTray.model;

public class Type {
	private String title = "";

	private String cmdToExecute = "";
	private Long id;

	@Override
	public boolean equals(Object o) {
		if (o instanceof Type) {
			return (((Type) (o)).id.equals(this.id));
		}
		return false;
	}

	public String getCmdToExecute() {
		return cmdToExecute;
	}

	public Long getId() {
		return id;
	}

	public String getTitle() {
		return title;
	}

	public Type setCmdToExecute(String cmdToExecute) {
		this.cmdToExecute = cmdToExecute;
		return this;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Type setTitle(String title) {
		this.title = title;
		return this;
	}

	public Type setId(String id) {
		if (id.isEmpty())
			return this;
		this.id = Long.parseLong(id);
		return this;
	}

	@Override
	public String toString() {
		return this.title;
	}

}
